package com.d3works.apps.account.service.payment.invoice.payment;

import com.d3works.apps.account.db.InvoicePayment;
import com.d3works.exception.D3worksException;
import com.google.inject.persist.Transactional;

public interface InvoicePaymentCancelService {

  /**
   * Method to cancel an invoice Payment
   *
   * <p>Cancel the eventual Move and Reconcile Compute the total amount paid on the linked invoice
   * Change the status to cancel
   *
   * @param invoicePayment An invoice payment
   * @throws D3worksException
   */
  @Transactional(rollbackOn = {Exception.class})
  public void cancel(InvoicePayment invoicePayment) throws D3worksException;

  @Transactional(rollbackOn = {Exception.class})
  public void updateCancelStatus(InvoicePayment invoicePayment) throws D3worksException;
}
